<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
     
    <div class="path_way left">
	  	<?php foreach ($breadcrumbs as $breadcrumb): ?>
	  	<?php if(isset($breadcrumb['parent_id']) && $breadcrumb['parent_id'] == 0):?>	  	
	  	<a href="<?php echo $breadcrumb['href'];?>"><?php echo $breadcrumb['text']?></a> 	  		  	
	  	<?php else:?>
	  	<?php if(isset($breadcrumb['parent_id'])):?>
	  	<a class="sub_path_way" href="<?php echo $breadcrumb['href']?>"><?php echo $breadcrumb['text']?></a>
	  	<?php else:?>
	  	<a  class="sub_path_way curent"><?php echo $breadcrumb['text']?></a>
	  	<?php endif;?>
	  	<?php endif;?>
	  	<?php endforeach;?>	  	
	</div> 
      
  <div id="product-info" class="content_sp clearboth">
  	<input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
  	<?php echo $description; ?>
  	<a class="icon_buynow"><img src="../catalog/view/theme/default/image/icon_buynow.png" /></a>
  </div>
  
  				<div class="dangkyphieugiamgia" id="bg_form_muahang">
                	<div style="position:relative">
                		<a href="javascript:void(0)" style="position:absolute;right:0;top:-22px;" id="popup_close"><img src="../catalog/view/theme/default/image/icon_close.png" /></a>
                    	<a href="javascript:void(0)" class="click_coupon"><img src="../image/data/dangkynhan_giamgia.png" alt="" title="" /></a>
                        <div class="form_dangky clearfix" style="display:block!important;">
                        	<div class="img_form_dangky">
                         	   <img src="../catalog/view/theme/default/image/img_coupon.png" />
                            </div>
                            <div class="info_form_dangky" id="checkout-info">
                            	<h2>ĐĂNG KÝ MUA NGAY BÂY GIỜ </h2>
                                <div class="div_text_coupon">Nhập thông tin vào các mục</div>
                                <div class="row_coupon clearfix">
                                	<span class="text_coupon">Họ và tên</span>
                                    <span class="input_coupon"><input type="text" name="name" class="class_input" /></span>
                                </div>
                                <div class="row_coupon clearfix">
                                	<span class="text_coupon">Email:</span>
                                    <span class="input_coupon"><input type="text" name="email" class="class_input" /></span>
                                </div>
                                <div class="row_coupon clearfix">
                                	<span class="text_coupon">Điện thoại</span>
                                    <span class="input_coupon"><input type="text" name="phone" onkeypress="return keypress(event);" class="class_input" /></span>
                                </div>
                                <div class="row_coupon clearfix">
                                	<span class="text_coupon">Địa chỉ:</span>
                                    <span class="input_coupon"><input type="text" name="address" class="class_input" /></span>
                                </div>
                                <input type="hidden" value="<?php echo $product_id?>" name="product_id"/>
                                
                                <div class="row_coupon maB2 maL10"><input type="checkbox" /> <span>Shop Home Picks and Deals</span></div>
                                <div class="row_coupon maB2 maL10"><input type="checkbox" /> <span>Shop Style Finds and Steals</span></div>
                                <div class="row_coupon maL10" style="margin-top:10px;"  id="accept"><input type="checkbox" /> <span>Tôi muốn nhận tin tức và cung cấp từ các ấn phẩm của bạn qua e-mail.</span></div>
                                <div class="row_coupon"><a href="javascript:void(0)" id="button_checkout"><img src="../catalog/view/theme/default/image/icon_send.png" /></a></div>
                            </div>
                            
                        </div>
                    </div>
                </div>                
    
   <?php if ($products) { ?>  
  
   <div class="box_center box_product clearfix">
		<div class="title">
			<a href="#">Các sản phẩm khác</a>
		</div>
						
		<div class="content clearfix" id="tabs-1">
        	<div class="scroll-pane_2">                                                       
            <div class="with_109 width_items_2">
            <?php $index=0; foreach($products as $product):?>
            <?php if($product['product_id'] != $product_id):?> 
            <?php if($index % 2 == 0):?>                                           						
            	<div class="items_two">	
            <?php endif;?>                							
            <div class="items_sp clearfix">
            <h3 class="name_items_items_sp"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']?></a></h3>		
            <a href="<?php echo $product['href']; ?>" class="img_items clearfix"><img src="<?php echo $product['thumb']; ?>" width="158" height="121" /></a>
            </div><!--end items-->                                
            <?php if($index != 0 && $index %2 ==1 || $index == count($products) -1):?>                   
                 </div><!--end items_two-->
            <?php endif;$index++;?>
            <?php endif;?>                                               															
			<?php endforeach;?>					
             </div><!--end with109-->                         
             </div>                         
        </div><!--END CONTENT-->															
					
   </div><!--end cac san pham khac-->	
    
   <?php } ?> 
   <?php echo $content_bottom; ?></div>
<script type="text/javascript">

//Guest
$('#button_checkout').live('click', function() {

	$.ajax({
		url: 'index.php?route=checkout/checkout_new/validate',
		type: 'post',
		data: $('#checkout-info input[type=\'text\'], #checkout-info input[type=\'hidden\'], #checkout-info input[type=\'radio\']:checked, #checkout-info input[type=\'checkbox\']:checked, #checkout-info select, #checkout-info textarea'),
		dataType: 'json',
		success: function(json) {			
			$('.success, .warning, .attention, information, .error').remove();
			
			if (json['error']) {
				if (json['error']['name']) {
					$('#checkout-info input[name=\'name\']').after('<span class="error">' + json['error']['name'] + '</span>');
				}
				if (json['error']['email']) {
					$('#checkout-info input[name=\'email\']').after('<span class="error">' + json['error']['email'] + '</span>');
				}
				if (json['error']['phone']) {
					$('#checkout-info input[name=\'phone\']').after('<span class="error">' + json['error']['phone'] + '</span>');
				}
				if (json['error']['address']) {
					$('#checkout-info input[name=\'address\']').after('<span class="error">' + json['error']['address'] + '</span>');
				}
			} 
			else{
				$.ajax({
					url: 'index.php?route=checkout/checkout_new',
					type: 'post',
					data: $('#checkout-info input[type=\'text\'], #checkout-info input[type=\'hidden\'], #checkout-info input[type=\'radio\']:checked, #checkout-info input[type=\'checkbox\']:checked, #checkout-info select, #checkout-info textarea'),
					dataType: 'json',
					success: function(json) {			
						$('.success, .warning, .attention, information, .error').remove();
						
						if (json['error']) {
							$('#accept').after('<span class="error">' + json['error']+ '</span>');
						} 
						else{
							$('#accept').after('<span class="error">' + json['success']+ '</span>');
						}
							
					}
				});
			}
				
		}
	});
	
});
function keypress(e){
var keypressed = null;
if (window.event)
{
keypressed = window.event.keyCode;
}
else
{ 
keypressed = e.which;
}

if (keypressed < 48 || keypressed > 57)
{
if (keypressed == 8 || keypressed == 127)
{
return;
}
return false;
}
}     
</script>

<?php echo $footer; ?>